import java.io.IOException;
import java.io.File;
import java.io.FileOutputStream;

class WriteSimpleFile
	{
	public static void main(String args[])
		{
		FileOutputStream fop = null;
		File f;
		String content = "This is the content";
		
		try
			{
			f = new File("xyz.txt");
			fop = new FileOutputStream(f);
			
			if(!f.exists())
				f.createNewFile();
			byte[] contentInBytes = content.getBytes();
		
			fop.write(contentInBytes);
			fop.flush();
			fop.close();
		
			System.out.println("Done");
		
			}
		catch(IOException e)
			{
			e.printStackTrace();
			}
		finally
			{
			try
				{
				if(fop!=null)
					{
					fop.close();
					}
				}
			catch(IOException e)
				{
				e.printStackTrace();
				}
			}
		}
	}
